package com.delaphone.fadmin.action;

import com.delaphone.flocash.web.bean.SelectList;
import java.util.ArrayList;

/**
 * Manage Customer Account
 * @author dongtv
 */
public class ManageServiceAction extends CoreAction {

    private int pageNumber = 1;
    private int pageSize = 4;
    private long totalPages;
    private ArrayList<SelectList> pages;
    private ArrayList<SelectList> serviceTypeList;
    private int serviceType;

    @Override
    public String execute() {


//        customers = customerService.findCustomers(startD, endD, email, firstName, lastName, city, country, pageSize, pageNumber);
//        long total = customerService.findCustomersRowCount(startD, endD, email, firstName, lastName, city, country);
        long total = 0;
        if (total == 0) {
            totalPages = 1;
        } else {
            totalPages = ((total - 1) / pageSize) + 1;
        }


        return SUCCESS;
    }

// <editor-fold defaultstate="collapsed" desc="get and set methods">
    public int getPageNumber() {
        return pageNumber;
    }

    public void setPageNumber(int pageNumber) {
        this.pageNumber = pageNumber;
    }

    public int getPageSize() {
        return pageSize;
    }

    public void setPageSize(int pageSize) {
        this.pageSize = pageSize;
    }

    public ArrayList<SelectList> getPages() {
        pages = new ArrayList<SelectList>();
        for (long i = 1; i <= totalPages; i++) {
            String id = String.valueOf(i);
            // String value="@<a href=/opt/doSearchCustomer.htm>"+id+"</a>";
            pages.add(new SelectList(id, id));

        }
        return pages;
    }

    public void setPages(ArrayList<SelectList> pages) {
        this.pages = pages;
    }

    public int getServiceType() {
        return serviceType;
    }

    public void setServiceType(int serviceType) {
        this.serviceType = serviceType;
    }

    public ArrayList<SelectList> getServiceTypeList() {
        serviceTypeList = new ArrayList<SelectList>();
        serviceTypeList.add(new SelectList("0", "All"));
        serviceTypeList.add(new SelectList("1", "Bill Payment Provider"));
        serviceTypeList.add(new SelectList("2", "E Topup Provider"));
        serviceTypeList.add(new SelectList("3", "Payout Partner"));

        return serviceTypeList;
    }

    public void setServiceTypeList(ArrayList<SelectList> serviceTypeList) {
        this.serviceTypeList = serviceTypeList;
    }
    // </editor-fold>
}
